<?php
  if(isset($msgSuccess)){
     echo "<div class=\"aui-message success\"><span class=\"aui-icon icon-success\"></span>$msgSuccess</div>";
	 echo "<div class=\"aui-message success\"><span class=\"aui-icon icon-success\"></span><a href=\"$baseUrl/index.php/login\">Login now</a></div>";
  }
?>
<?php
  /*if(isset($msgError)){
     echo "<div class=\"aui-message error\"><span class=\"aui-icon icon-error\"></span>$msgError</div>";

  }*/
?>
<div>
<form action="<?= $this->config->base_url() ?>index.php/register" method="post" class="aui">

       <div id="context"></div>
       <fieldset class="form-fields">
                 <div class="field-group">
                       <label for="country">Country<span class="aui-icon icon-required"><span>(required)</span></span></label>
                       <?= form_dropdown('country', $countries, set_value('country') , ' class="aui select"') ?>
                       <div class="error"><?= form_error('country') ?></div>
                 </div>
                 <div class="field-group">
			        <label for="username">Username <span class="aui-icon icon-required"><span>(required)</span></span></label>
			        <input class="text medium-field" type="text" id="username" name="username" value="<?= set_value('username') ?>">
                    <div class="error"><?= form_error('username') ?></div>
				    <div class="description">Unique username that you will use for login in the future</div>
				 </div> 
                 <div class="field-group">
			        <label for="email">Email<span class="aui-icon icon-required"><span>(required)</span></span></label>
			        <input class="text long-field" type="text" id="email" name="email" value="<?= set_value('email') ?>">
                    <div class="error"><?= form_error('email') ?></div>
				    <div class="description">Your email address. e.g. johndoe@mail.com</div>
				 </div> 
                 <div class="field-group">
			        <label for="password">Password<span class="aui-icon icon-required"><span>(required)</span></span></label>
			        <input class="text medium-field" type="password" id="password" name="password">
                    <div class="error"><?= form_error('password') ?></div>
				    <div class="description">Must have uppercase letter, lowercase letter, and number. Minimum 8 characters length</div>
			     </div>
                 <div class="field-group">
			        <label for="password2">Reinput Password<span class="aui-icon icon-required"><span>(required)</span></span></label>
			        <input class="text medium-field" type="password" id="password" name="password2">
			     </div>
       </fieldset>
       <fieldset class="form-fields"> 
      			 <div class="field-group">
			        <label for="first_name">First Name<span class="aui-icon icon-required"><span>(required)</span></span></label>
			        <input class="text long-field" type="text" id="first_name" name="first_name" value="<?= set_value('first_name') ?>">
                    <div class="error"><?= form_error('first_name') ?></div>
				 </div> 
      			 <div class="field-group">
			        <label for="last_name">Last Name</label>
			        <input class="text long-field" type="text" id="last_name" name="last_name" value="<?= set_value('last_name') ?>">
                    <div class="error"><?= form_error('last_name') ?></div>
				 </div> 
					
				 <fieldset class="group">
			        <legend><span>Gender</span></legend>
                     <div class="matrix">
                        <div class="radio">
                            <input class="radio" type="radio" id="irMale" name="gender" value="M" <?= (set_value('gender')=='M'||set_value('gender')=='') ? 'checked="checked"' : '' ?> />
                            <label for="irMale">Male</label>
                        </div>
                        <div class="radio">
                            <input class="radio" type="radio" id="irFemale" name="gender" value="F" <?= (set_value('gender')=='F') ? 'checked="checked"' : '' ?>/>
                            <label for="irFemale">Female</label>
                        </div>
                     </div>

				 </fieldset>
       			 <div class="field-group">
			        <label for="phone">Phone</label>
			        <input class="text medium-field" type="text" id="phone" name="phone" value="<?= set_value('phone') ?>">
                    <div class="error"><?= form_error('phone') ?></div>
				 </div> 
                 <div class="field-group">
			        <label for="address1">Address Line 1</label>
			        <input class="text long-field" type="text" id="address1" name="address1" value="<?= set_value('address1') ?>">
                    <div class="error"><?= form_error('address1') ?></div>
				 </div> 
                 <div class="field-group">
			        <label for="address2">Address Line 2</label>
			        <input class="text long-field" type="text" id="address2" name="address2" value="<?= set_value('address2') ?>">
                    <div class="error"><?= form_error('address2') ?></div>
				 </div> 
                 <div class="field-group">
			        <label for="city">City</label>
			        <input class="text medium-field" type="text" id="city" name="city" value="<?= set_value('city') ?>">
                    <div class="error"><?= form_error('city') ?></div>
				 </div> 
                 <div class="field-group">
			        <label for="province_state">Province/State</label>
			        <input class="text medium-field" type="text" id="province_state" name="province_state" value="<?= set_value('province_state') ?>">
                    <div class="error"><?= form_error('province_state') ?></div>
				 </div> 
                 <div class="field-group">
			        <label for="postal_code">Postal Code</label>
			        <input class="text short-field" type="text" id="postal_code" name="postal_code">
                    <div class="error"><?= form_error('postal_code') ?></div>
				 </div> 
                 <div class="field-group">
			        <label for="facebook">Facebook</label>
			        <input class="text long-field" type="text" id="facebook" name="facebook">
                    <div class="error"><?= form_error('facebook') ?></div>
				 </div> 
                 <div class="field-group">
			        <label for="twitter">Twitter</label>
			        <input class="text long-field" type="text" id="twitter" name="twitter">
                    <div class="error"><?= form_error('twitter') ?></div>
				 </div> 
                 <div class="field-group">
			        <label for="website">Website</label>
			        <input class="text long-field" type="text" id="website" name="website">
                    <div class="error"><?= form_error('website') ?></div>
				 </div> 
                  <div class="field-group">
                  		<input type="submit" value="Register" class="aui-button aui-button-primary"/>
                        <a href="./learn-more" class="aui-button">Learn More</a>
                        <a href="./login" class="aui-button">Login Now</a>
                  </div>
       </fieldset>
</form>
</div>